package com.example.idachuappone.index.welcomentity;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import org.json.JSONObject;

public class WelcomeUri {
    private Map<String, String> params;
    private String url;

    public WelcomeUri parseJson(JSONObject json) {
        if (json == null) {
            return null;
        }
        if (json.has("url")) {
            this.url = json.optString("url");
        }
        if (!json.has("params")) {
            return this;
        }
        Iterator<String> iterator = json.optJSONObject("params").keys();
        this.params = new HashMap();
        while (iterator.hasNext()) {
            try {
                String key = (String) iterator.next();
                this.params.put(key, json.optJSONObject("params").getString(key));
            } catch (Exception e) {
            }
        }
        return this;
    }

    public String getUrl() {
        return this.url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public Map<String, String> getParams() {
        return this.params;
    }

    public void setParams(Map<String, String> params) {
        this.params = params;
    }
}
